// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: src/common/base/statuspb/status.proto

package statuspb

import (
	fmt "fmt"
	proto "github.com/gogo/protobuf/proto"
	types "github.com/gogo/protobuf/types"
	io "io"
	math "math"
	math_bits "math/bits"
	reflect "reflect"
	strconv "strconv"
	strings "strings"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type Code int32

const (
	OK                   Code = 0
	CANCELLED            Code = 1
	UNKNOWN              Code = 2
	INVALID_ARGUMENT     Code = 3
	DEADLINE_EXCEEDED    Code = 4
	NOT_FOUND            Code = 5
	ALREADY_EXISTS       Code = 6
	PERMISSION_DENIED    Code = 7
	UNAUTHENTICATED      Code = 8
	INTERNAL             Code = 9
	UNIMPLEMENTED        Code = 10
	RESOURCE_UNAVAILABLE Code = 11
	SYSTEM               Code = 12
	FAILED_PRECONDITION  Code = 13
	DO_NOT_USE_          Code = 100
)

var Code_name = map[int32]string{
	0:   "OK",
	1:   "CANCELLED",
	2:   "UNKNOWN",
	3:   "INVALID_ARGUMENT",
	4:   "DEADLINE_EXCEEDED",
	5:   "NOT_FOUND",
	6:   "ALREADY_EXISTS",
	7:   "PERMISSION_DENIED",
	8:   "UNAUTHENTICATED",
	9:   "INTERNAL",
	10:  "UNIMPLEMENTED",
	11:  "RESOURCE_UNAVAILABLE",
	12:  "SYSTEM",
	13:  "FAILED_PRECONDITION",
	100: "DO_NOT_USE_",
}

var Code_value = map[string]int32{
	"OK":                   0,
	"CANCELLED":            1,
	"UNKNOWN":              2,
	"INVALID_ARGUMENT":     3,
	"DEADLINE_EXCEEDED":    4,
	"NOT_FOUND":            5,
	"ALREADY_EXISTS":       6,
	"PERMISSION_DENIED":    7,
	"UNAUTHENTICATED":      8,
	"INTERNAL":             9,
	"UNIMPLEMENTED":        10,
	"RESOURCE_UNAVAILABLE": 11,
	"SYSTEM":               12,
	"FAILED_PRECONDITION":  13,
	"DO_NOT_USE_":          100,
}

func (Code) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d00469c326868ac4, []int{0}
}

type LifeCycleState int32

const (
	UNKNOWN_STATE    LifeCycleState = 0
	PENDING_STATE    LifeCycleState = 1
	RUNNING_STATE    LifeCycleState = 2
	FAILED_STATE     LifeCycleState = 3
	TERMINATED_STATE LifeCycleState = 4
)

var LifeCycleState_name = map[int32]string{
	0: "UNKNOWN_STATE",
	1: "PENDING_STATE",
	2: "RUNNING_STATE",
	3: "FAILED_STATE",
	4: "TERMINATED_STATE",
}

var LifeCycleState_value = map[string]int32{
	"UNKNOWN_STATE":    0,
	"PENDING_STATE":    1,
	"RUNNING_STATE":    2,
	"FAILED_STATE":     3,
	"TERMINATED_STATE": 4,
}

func (LifeCycleState) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d00469c326868ac4, []int{1}
}

type Status struct {
	ErrCode Code       `protobuf:"varint,1,opt,name=err_code,json=errCode,proto3,enum=px.statuspb.Code" json:"err_code,omitempty"`
	Msg     string     `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Context *types.Any `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
}

func (m *Status) Reset()      { *m = Status{} }
func (*Status) ProtoMessage() {}
func (*Status) Descriptor() ([]byte, []int) {
	return fileDescriptor_d00469c326868ac4, []int{0}
}
func (m *Status) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Status.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *Status) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Status.Merge(m, src)
}
func (m *Status) XXX_Size() int {
	return m.Size()
}
func (m *Status) XXX_DiscardUnknown() {
	xxx_messageInfo_Status.DiscardUnknown(m)
}

var xxx_messageInfo_Status proto.InternalMessageInfo

func (m *Status) GetErrCode() Code {
	if m != nil {
		return m.ErrCode
	}
	return OK
}

func (m *Status) GetMsg() string {
	if m != nil {
		return m.Msg
	}
	return ""
}

func (m *Status) GetContext() *types.Any {
	if m != nil {
		return m.Context
	}
	return nil
}

func init() {
	proto.RegisterEnum("px.statuspb.Code", Code_name, Code_value)
	proto.RegisterEnum("px.statuspb.LifeCycleState", LifeCycleState_name, LifeCycleState_value)
	proto.RegisterType((*Status)(nil), "px.statuspb.Status")
}

func init() {
	proto.RegisterFile("src/common/base/statuspb/status.proto", fileDescriptor_d00469c326868ac4)
}

var fileDescriptor_d00469c326868ac4 = []byte{
	// 532 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x92, 0xcb, 0x4e, 0xdb, 0x4c,
	0x14, 0xc7, 0x3d, 0x09, 0x5f, 0x12, 0x26, 0x5c, 0x86, 0x81, 0x4f, 0x4d, 0xbb, 0x18, 0xa1, 0x4a,
	0x95, 0x10, 0xaa, 0x1c, 0x89, 0xee, 0x2b, 0x0d, 0x9e, 0x03, 0x1d, 0xe1, 0x1c, 0x47, 0xf6, 0x98,
	0x42, 0x37, 0x16, 0x09, 0x06, 0x55, 0x22, 0x71, 0xea, 0x04, 0x29, 0xd9, 0xf5, 0x11, 0xba, 0xeb,
	0x2b, 0xf4, 0x51, 0xba, 0xcc, 0x92, 0x65, 0xe3, 0x6c, 0xba, 0xe4, 0x11, 0xaa, 0xc9, 0x45, 0xed,
	0xee, 0xe8, 0x77, 0xce, 0xfc, 0xff, 0xe7, 0x32, 0xf4, 0xcd, 0x30, 0xef, 0x36, 0xbb, 0x59, 0xaf,
	0x97, 0xf5, 0x9b, 0x9d, 0x9b, 0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4, 0xfd, 0x74, 0x26, 0x9c, 0xa7, 0x99, 0x70, 0x9e, 0x67, 0x82, 0x7c, 0x2d, 0x04,
	0xf9, 0x51, 0x08, 0xf2, 0xb3, 0x10, 0x64, 0x5a, 0x08, 0xf2, 0xab, 0x10, 0xe4, 0x77, 0x21, 0x9c,
	0xe7, 0x42, 0x90, 0x6f, 0x73, 0xe1, 0x4c, 0xe7, 0xc2, 0x79, 0x9a, 0x0b, 0xe7, 0x53, 0x6d, 0xfd,
	0x39, 0x3a, 0x95, 0xc5, 0x8d, 0xdf, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x93, 0x7a, 0x3e, 0xf5,
	0x9e, 0x02, 0x00, 0x00,
}

func (x Code) String() string {
	s, ok := Code_name[int32(x)]
	if ok {
		return s
	}
	return strconv.Itoa(int(x))
}
func (x LifeCycleState) String() string {
	s, ok := LifeCycleState_name[int32(x)]
	if ok {
		return s
	}
	return strconv.Itoa(int(x))
}
func (this *Status) Equal(that interface{}) bool {
	if that == nil {
		return this == nil
	}

	that1, ok := that.(*Status)
	if !ok {
		that2, ok := that.(Status)
		if ok {
			that1 = &that2
		} else {
			return false
		}
	}
	if that1 == nil {
		return this == nil
	} else if this == nil {
		return false
	}
	if this.ErrCode != that1.ErrCode {
		return false
	}
	if this.Msg != that1.Msg {
		return false
	}
	if !this.Context.Equal(that1.Context) {
		return false
	}
	return true
}
func (this *Status) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 7)
	s = append(s, "&statuspb.Status{")
	s = append(s, "ErrCode: "+fmt.Sprintf("%#v", this.ErrCode)+",\n")
	s = append(s, "Msg: "+fmt.Sprintf("%#v", this.Msg)+",\n")
	if this.Context != nil {
		s = append(s, "Context: "+fmt.Sprintf("%#v", this.Context)+",\n")
	}
	s = append(s, "}")
	return strings.Join(s, "")
}
func valueToGoStringStatus(v interface{}, typ string) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func (m *Status) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Status) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Context != nil {
		{
			size, err := m.Context.MarshalToSizedBuffer(dAtA[:i])
			if err != nil {
				return 0, err
			}
			i -= size
			i = encodeVarintStatus(dAtA, i, uint64(size))
		}
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Msg) > 0 {
		i -= len(m.Msg)
		copy(dAtA[i:], m.Msg)
		i = encodeVarintStatus(dAtA, i, uint64(len(m.Msg)))
		i--
		dAtA[i] = 0x12
	}
	if m.ErrCode != 0 {
		i = encodeVarintStatus(dAtA, i, uint64(m.ErrCode))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func encodeVarintStatus(dAtA []byte, offset int, v uint64) int {
	offset -= sovStatus(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *Status) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.ErrCode != 0 {
		n += 1 + sovStatus(uint64(m.ErrCode))
	}
	l = len(m.Msg)
	if l > 0 {
		n += 1 + l + sovStatus(uint64(l))
	}
	if m.Context != nil {
		l = m.Context.Size()
		n += 1 + l + sovStatus(uint64(l))
	}
	return n
}

func sovStatus(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozStatus(x uint64) (n int) {
	return sovStatus(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *Status) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&Status{`,
		`ErrCode:` + fmt.Sprintf("%v", this.ErrCode) + `,`,
		`Msg:` + fmt.Sprintf("%v", this.Msg) + `,`,
		`Context:` + strings.Replace(fmt.Sprintf("%v", this.Context), "Any", "types.Any", 1) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringStatus(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *Status) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowStatus
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Status: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field ErrCode", wireType)
			}
			m.ErrCode = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowStatus
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.ErrCode |= Code(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowStatus
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthStatus
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthStatus
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Msg = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowStatus
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthStatus
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthStatus
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.Context == nil {
				m.Context = &types.Any{}
			}
			if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipStatus(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthStatus
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipStatus(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowStatus
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowStatus
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowStatus
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthStatus
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupStatus
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthStatus
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthStatus        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStatus          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStatus = fmt.Errorf("proto: unexpected end of group")
)
